<?php
$dt = new DataTable(constant('DB_TABLE_PAGE_CONTENT'));
$act = isset($_REQUEST['act'])?$_REQUEST['act']:'';
$GLOBALS['PAGE_FORM_DATA'] = $dt->get_row(sprintf("`page_id`=%d", $_REQUEST['page_id']));
if ( !$GLOBALS['PAGE_FORM_DATA'] ) {
	$GLOBALS['PAGE_FORM_DATA'] = array('id'=>0,'page_id'=> $_REQUEST['page_id'],'content'=>'');
}
if ( $act == 'save' ) {
	$GLOBALS['PAGE_FORM_DATA']['content'] = $_REQUEST['content'];
	$dt->save($GLOBALS['PAGE_FORM_DATA']);
}

?>